package com.itheima.反射.Constructor.demo1;

public class ReflectDemo {
    public static void main(String[] args) throws ClassNotFoundException {
        //Class类中的静态方法forName("全类名")获取class对象
        Class clazz = Class.forName("com.itheima.反射.Constructor.demo1.Student");
        System.out.println("clazz = " + clazz);

        //Class属性获取class对象
        Class studentClass = Student.class;
        System.out.println("studentClass = " + studentClass);

        //Class对象的getClass()方法获取class对象
        //getClass()是定义在object类中的
        Student student = new Student();
        Class aClass = student.getClass();
        System.out.println("aClass = " + aClass);
    }
}
